#include <QtGui/QApplication>
#include <QFile>
#include <QDir>
#include <QTimer>
#include "mainwindow.h"

void loadSkin(QApplication *app);

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);

	MainWindow mainWindow;
	mainWindow.show();

    loadSkin(&app);

	return app.exec();
}

void loadSkin(QApplication *app){
	QFile qss("skin.qss");
	QString styleSheet = "";

	if(qss.exists()){
		qss.open(QFile::ReadOnly);
		styleSheet = qss.readAll();
		qss.close();
	} else {
        QFile defaultQss(":stylesheets/default.qss");
        defaultQss.open(QFile::ReadOnly);
        styleSheet = defaultQss.readAll();
        defaultQss.close();
    }

	app->setStyleSheet(styleSheet);
}
